package com.ricchieri.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="emailTemplate")
public class EmailTemplate extends BaseEntity {
	private static final long serialVersionUID = 3659012058181068675L;
	
	@Column(name="subject", nullable=false, length=100)
	private String subject;
	
	@Column(name="template", nullable=false, length=500)
	private String template;
	
	@Column(name="isDefault", nullable=false)
	private Boolean isDefault = Boolean.FALSE;
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "emailToSendType", nullable = false)
	private EmailToSendType emailToSendType;
	
	public String getTemplate() {
		return template;
	}
	
	public void setTemplate(String template) {
		this.template = template;
	}
	
	public Boolean getIsDefault() {
		return isDefault;
	}
	
	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

	public EmailToSendType getEmailToSendType() {
		return emailToSendType;
	}

	public void setEmailToSendType(EmailToSendType emailToSendType) {
		this.emailToSendType = emailToSendType;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}
}
